home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / fido / ttfc21.lha / TicTacFooz.rexx < prev    next >
OS/2 REXX Batch file  |  1995-06-16  |  16KB  |  434 lines

  1. /* CrTicTacFoozle originally by PSR Software (©1993 for Spot) updated by
  2.    David Lascelles, Creepy Productions - 2:256/503.0
  3.    $VER: CrTicTacFoozle v1.0 (10.06.95)
  4.    I have decided to leave this file open for inspection, please do not
  5. change anything below the line if it works, and if you do change to
  6. produce what you consider a better result, please forward it to me. :)
  7. */
  8.  
  9. parse arg AREA NUMBER FRoM FRoM2 NAME NAME2
  10.  
  11. /*change!*/
  12.  
  13. origin="Call Creepys BBS - 0191 3832181 - for Foozle and TA support!"
  14.  
  15. add="2:256/503"
  16. TEMPDIR='T:'     /*Temp Directory*/
  17. EDITCMD='c:ed'   /* editor to use! if C='s ed then -sticky!*/
  18.  
  19.  
  20.  
  21. /* Do not change, except for personal use - or return to author.*/
  22.  
  23. Do y=1 To 4
  24. Do x=1 To 3
  25. PoS.x.y=' '
  26. end
  27. end
  28. from=from||" "||from2
  29. name=name||""||name2
  30. addlib('rexxreqtools.library',0,-30)
  31. NL='0a'x
  32. addlib("rexxsupport.library",0,-30)
  33. addlib("rexxarplib.library",0,-30,0)
  34. de=Area"/"number".msg"
  35. begin:
  36. ret=rtezrequest("Scan Message ?!?","S_can|_Start|_Info","There is only one thing better than Info - and you're too young!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=bronze.font/70")
  37. if ret=1 then do;signal ddw;end
  38. if ret=2 then signal David
  39. if ret=0 then call INFo
  40. ddw:
  41.  
  42.  
  43. call open(msg,de,"R")
  44. all=readch(msg,65535)
  45. From=substr(all,1,36)
  46. To=substr(all,37,36)
  47. Subj=substr(all,73,72)
  48. Date=substr(all,145,20)
  49. Dest=substr(all,167,2)
  50. orig=substr(all,169,2)
  51. Mess=substr(all,216)
  52. From=strip(from,'t','00'x)
  53. To=strip(to,'t','00'x)
  54. Subj=strip(subj,'t','00'x)
  55. Date=strip(date,'t','00'x)
  56. orig=strip(orig,'t','00'x)
  57. do i=1 to length(mess)
  58. x=substr(mess,i,1)
  59. if x='00'x then iterate
  60. if x='0d'x then x='0a'x
  61. call open(nm,TEMPDIR'TicTacFooz.temp',"w")
  62. call writech(nm,x)
  63. end
  64. call close(msg)
  65. call close(nm)
  66. dedew:
  67. call open(nm,TEMPDIR'TicTacFooz.temp',"r")
  68. Do y=1 To 4
  69. Do x=1 To 3
  70. PoS.x.y=' '
  71. End
  72. End
  73. Do Until Pos('* TicTacSpot',LINE)>0
  74. If Eof(nm) Then Do
  75. retqw=rtezrequest("Message contains no TicTacFoozle data!","_Quit|_Start New","You needed a FX430303 Scanner with a banana to do that ;).","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=mfast.font/20")
  76. if retqw=0 then do
  77. Call Close(nm)
  78. Signal David
  79. End
  80. Exit
  81. end
  82. If Exists('Ram:Plop') then Exit
  83. LINE=ReadLn(nm)
  84. End
  85. Call Readln(nm)
  86. LINE.1=Readln(nm)
  87. Call Readln(nm)
  88. Call Readln(nm)
  89. LINE.2=Readln(nm)
  90. Call Readln(nm)
  91. Call Readln(nm)
  92. LINE.3=Readln(nm)
  93. deded=readln(nm)
  94. edwdkwdokwk=readln(nm)
  95. piece=readch(nm)
  96. if piece="o" then pw="x"
  97. if piece="x" then pw="o"
  98. Call Close(nm)
  99. piece=pw
  100. Do y=1 To 3
  101. Parse var LINE.y PoS1' | 'PoS2' | 'PoS3
  102. PoS1=Right(PoS1,2)
  103. PoS2=Left(PoS2,2)
  104. PoS3=Left(PoS3,2)
  105. If PoS1='/\' Then PoS.1.y='o'
  106. If PoS1='\/' Then PoS.1.y='x'
  107. If PoS2='/\' Then PoS.2.y='o'
  108. If PoS2='\/' Then PoS.2.y='x'
  109. If PoS3='/\' Then PoS.3.y='o'
  110. If PoS3='\/' Then PoS.3.y='x'
  111. End
  112. signal playmove
  113. david:
  114. from=rtgetstring("","Enter name of person to play with ??","Who are you going to play with today ? (Not *HIM*)!","_Done","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=brats.font/16",RCDE)
  115. if upper(piece)="X" then signal ed
  116. if upper(piece)="O" then signal ed
  117. PlayMove:
  118. if upper(piece)="X" then signal ed
  119. if upper(piece)="O" then signal ed
  120. retox=rtezrequest("Will you be Os or Xs?","_O|_X","Hard descision - the round one or the non-round one ?","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=chex.font/26",RCDA)
  121. If retox=0 Then PIECE='x'
  122. If retox=1 Then PIECE='o'
  123. call bob                                                                                             
  124. ed:
  125. reatox=rtezrequest("In case you forgot, you are '"upper(piece)"'s","cool!","Bad memory ?","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=emerald.font/17",RCDAA)
  126. bob:
  127. done=0
  128. Do Until DoNE=1
  129. board=""upper(pos.1.1)" + "upper(pos.2.1)" + "upper(pos.3.1)" "
  130. board2="++++++++++"
  131. board3=""upper(pos.1.2)" + "upper(pos.2.2)" + "upper(pos.3.2)" "
  132. board4="++++++++++"
  133. board5=""upper(pos.1.3)" + "upper(pos.2.3)" + "upper(pos.3.3)" "
  134.                                   
  135. retawq=rtezrequest("Row 1  =  "board"    You are now on the top"||NL||,
  136.                     "          "board2"    row, select where to"||NL||,
  137.                     "Row 2  =  "board3"    place  piece or click"||NL||,
  138.                     "          "board4"    on Middle Row to go  "||NL||,                   
  139.                     "Row 3  =  "board5"    to the middle row. :)"||NL||NL||,
  140.                     "Click on Big for the large tactics screen! ;)"||NL||,
  141.                     "","_Left|_Mid|_Right|M_iddle Row|_Big|_Exit","The high chain of command informs you that this is the top row!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=ruby.font/15",DW)
  142.  
  143. if retawq=1 Then If PoS.1.1='x'|Pos.1.1='o' then do;call exista;signal bob;end
  144. If retawq=1 Then do;If PoS.1.1=' ' Then DoNE=1;PoS.1.1=PIECE;signal ced;End
  145. if retawq=2 Then If PoS.2.1='x'|Pos.2.1='o' then do;call exista;signal bob;end
  146. IF retawq=2 Then If PoS.2.1=' ' Then Do;DoNE=1;PoS.2.1=PIECE;signal ced;End
  147. if retawq=3 Then If PoS.3.1='x'|Pos.3.1='o' then do;call exista;signal bob;end
  148. If retawq=3 Then If PoS.3.1=' ' Then Do;DoNE=1;pos.3.1=piece;signal ced;End
  149. if retawq=5 then call big
  150. if retawq=0 then exit 0
  151. reta=rtezrequest("Row 1 = "board"    You are now in the middle"||NL||,
  152.                     "        "board2"    row, select where to"||NL||,
  153.                     "Row 2 = "board3"    place piece or click"||NL||,
  154.                     "        "board4"    on Bottom Row to go :( "||NL||,                   
  155.                     "Row 3 = "board5"    to the Bottom row :) "||NL||NL||,
  156.                     "BIG will display a rather large board indeed!"||NL||,
  157.                     "","_Left|_Mid|_Right|_Bottom Row|Bi_g|_Exit","Oi you! What you doing in the middle row, trying to cheat eh ? ","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=ruby.font/15",DWSQ)
  158. if reta=0 then exit 0
  159. if reta=5 then call big
  160. if reta=1 Then If PoS.1.2='x'|Pos.1.2='o' Then do;call exista;signal bob;end
  161. If reta=1 Then If PoS.1.2=' ' Then Do;DoNE=1;PoS.1.2=PIECE;signal ced;End
  162. if reta=2 Then If PoS.2.2='x'|Pos.2.2='o' then do;call exista;signal bob;end
  163. If reta=2 Then If PoS.2.2=' ' Then Do;DoNE=1;PoS.2.2=PIECE;signal ced;End
  164. say pos.3.1
  165. if reta=3 Then If PoS.3.2='x'|Pos.3.2='o' then do;call exista;signal bob;end
  166. If reta=3 Then If PoS.3.2=' ' Then Do;DoNE=1;PoS.3.2=PIECE;signal ced;End
  167. retw=rtezrequest("Row 1 = "board"    You are now on the Bottom"||NL||,
  168.                     "        "board2"    row, select where to"||NL||,
  169.                     "Row 2 = "board3"    place piece or click"||NL||,
  170.                     "        "board4"    on exit to go to back "||NL||,                   
  171.                     "Row 3 = "board5"    to foozle."||NL||NL||,
  172.                     "This time BIG will display the same as before!"||NL||,
  173.                     "","_Left|_Mid|_Right|_Big|_Top Row!!|_Exit","lowest of the low, scum of the earth - well the bottom row!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=ruby.font/15",DWSA)
  174.  
  175.  
  176. If retw=0 Then exit 0
  177. if retw=4 then call big
  178. if retw=1 Then If PoS.1.3='x'|Pos.1.3='o' then do;call exista;signal bob;end
  179. If retw=1 Then If PoS.1.3=' ' Then Do;DoNE=1;PoS.1.3=PIECE;signal ced;End
  180. if retw=2 Then If PoS.2.3='x'|Pos.2.3='o' then do;call exista;signal bob;end
  181. If retw=2 Then If PoS.2.3=' ' Then Do;DoNE=1;PoS.2.3=PIECE;signal ced;End
  182. if retw=3 Then If PoS.3.3='x'|Pos.3.3='o' then do;call exista;signal bob;end
  183. If retw=3 Then If PoS.3.3=' ' Then Do;DoNE=1;PoS.3.3=PIECE;signal ced;End
  184. if retw=5 then signal bob
  185. End
  186. End
  187. End
  188. ced:
  189. Call open('oup',TEMPDIR'TicTacFooza.temp','w')
  190. LINE1=' >  '
  191. LINE2=' >  '
  192. LINE3=' >  '
  193. LINE4=' >  '
  194. LINE5=' >  '
  195. LINE6=' >  '
  196. If PoS.1.1='x' Then Do
  197. LINE1=LINE1||'\/ |'
  198. LINE2=LINE2||'/\ |'
  199. End
  200. If PoS.1.1=' ' Then Do
  201. LINE1=LINE1||'   |'
  202. LINE2=LINE2||'   |'
  203. End
  204. If PoS.1.1='o' Then Do
  205. LINE1=LINE1||'/\ |'
  206. LINE2=LINE2||'\/ |'
  207. End
  208. If PoS.2.1='x' Then Do
  209. LINE1=LINE1||' \/ |'
  210. LINE2=LINE2||' /\ |'
  211. End
  212. If PoS.2.1='o' Then Do
  213. LINE1=LINE1||' /\ |'
  214. LINE2=LINE2||' \/ |'
  215. End
  216. If PoS.2.1=' ' Then Do
  217. LINE1=LINE1||'    |'
  218. LINE2=LINE2||'    |'
  219. End
  220. If PoS.3.1='x' Then Do
  221. LINE1=LINE1||' \/'
  222. LINE2=LINE2||' /\'
  223. End
  224. If PoS.3.1='o' Then Do
  225. LINE1=LINE1||' /\'
  226. LINE2=LINE2||' \/'
  227. End
  228. If PoS.3.1=' ' Then Do
  229. LINE1=LINE1||'   '
  230. LINE2=LINE2||'   '
  231. End
  232. If PoS.1.2='x' Then Do
  233. LINE3=LINE3||'\/ |'
  234. LINE4=LINE4||'/\ |'
  235. End
  236. If PoS.1.2='o' Then Do
  237. LINE3=LINE3||'/\ |'
  238. LINE4=LINE4||'\/ |'
  239. End
  240. If PoS.1.2=' ' Then Do
  241. LINE3=LINE3||'   |'
  242. LINE4=LINE4||'   |'
  243. End
  244. If PoS.2.2='x' Then Do
  245. LINE3=LINE3||' \/ |'
  246. LINE4=LINE4||' /\ |'
  247. End
  248. If PoS.2.2='o' Then Do
  249. LINE3=LINE3||' /\ |'
  250. LINE4=LINE4||' \/ |'
  251. End
  252. If PoS.2.2=' ' Then Do
  253. LINE3=LINE3||'    |'
  254. LINE4=LINE4||'    |'
  255. End
  256. If PoS.3.2='x' Then Do
  257. LINE3=LINE3||' \/'
  258. LINE4=LINE4||' /\'
  259. End
  260. If PoS.3.2='o' Then Do
  261. LINE3=LINE3||' /\'
  262. LINE4=LINE4||' \/'
  263. End
  264. If PoS.3.2=' ' Then Do
  265. LINE3=LINE3||'   '
  266. LINE4=LINE4||'   '
  267. End
  268. If PoS.1.3='x' Then Do
  269. LINE5=LINE5||'\/ |'
  270. LINE6=LINE6||'/\ |'
  271. End
  272. If PoS.1.3='o' Then Do
  273. LINE5=LINE5||'/\ |'
  274. LINE6=LINE6||'\/ |'
  275. End
  276. If PoS.1.3=' ' Then Do
  277. LINE5=LINE5||'   |'
  278. LINE6=LINE6||'   |'
  279. End
  280. If PoS.2.3='x' Then Do
  281. LINE5=LINE5||' \/ |'
  282. LINE6=LINE6||' /\ |'
  283. End
  284. If PoS.2.3='o' Then Do
  285. LINE5=LINE5||' /\ |'
  286. LINE6=LINE6||' \/ |'
  287. End
  288. If PoS.2.3=' ' Then Do
  289. LINE5=LINE5||'    |'
  290. LINE6=LINE6||'    |'
  291. End
  292. If PoS.3.3='x' Then Do
  293. LINE5=LINE5||' \/'
  294. LINE6=LINE6||' /\'
  295. End
  296. If PoS.3.3='o' Then Do
  297. LINE5=LINE5||' /\'
  298. LINE6=LINE6||' \/'
  299. End
  300. If PoS.3.3=' ' Then Do
  301. LINE5=LINE5||'   '
  302. LINE6=LINE6||'   '
  303. End
  304. Call Writeln('oup',' ')
  305. Call Writeln('oup',' > * TicTacSpot v2.0 Updated By Creepy (Foozle Version)')
  306. Call Writeln('oup',' >')
  307. Call Writeln('oup',LINE1)
  308. Call Writeln('oup',LINE2)
  309. Call Writeln('oup',' > ----+----+----')
  310. Call Writeln('oup',LINE3)
  311. Call Writeln('oup',LINE4)
  312. Call Writeln('oup',' > ----+----+----')
  313. Call Writeln('oup',LINE5)
  314. Call Writeln('oup',LINE6)
  315. Call Writeln('oup',' ')
  316. Call Writeln('oup',piece)
  317. Call Close('oup')
  318. origino=""""origin""""
  319. from=""""from""""
  320. name=""""name""""
  321. area=""""area""""
  322. add=""""add""""
  323. rte=rtezrequest("Do you want to edit the message ?","_Yes|_No","Edit Message or eat it ?","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=sapphire.font/19")
  324. if rte=1 then address command editcmd" "tempdir"tictacFooza.temp"
  325. address command "c:brun MAKEMAIL oRIGIN "origino" dir "AREA" subject  TicTacFoozle  FRoM "name" To "from" FRoMADR "ADD" FILE "tempdir"TicTacFooza.temp"
  326. address command "delete "tempdir"TicTacFooza.temp"                                                                                   
  327. exit 0                                           
  328.                                            
  329. exista:
  330. retaa=rtezrequest("Sorry - Piece already there","_Return","And where is the brain today!!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=coop.font/24",re)
  331. return
  332.  
  333. INFo:
  334.  
  335. retaa=rtezrequest("Welcome to Creepys TicTacToe whether you be a foozle owner    "||NL||,
  336.        "or a spot one, I salute you ;) I hope you like this script  "||NL||,
  337.        "as it took three of us a while to write (the other two being "||NL||,
  338.        "Paul and John, who were respectivly responsible for the    "||NL||,
  339.        "original code and for the message reading part in the Foozle  "||NL||,                                                                                    
  340.        "code.) I also hope you like this new GUI interface and only   "||NL||,                                                                                    
  341.        "appologise for the amount of fonts you had to download to    "||NL||,
  342.        "use it! If you want a chat or just grab some files, then    "||NL||,
  343.        "why not logon to Creepys Amiga BBS - +44(0)191 3832181 24Hrs  "||NL||,
  344.        "its well worth a vist! Also if you use this proggy I would "||NL||,
  345.        "be grateful for a hello note to one of the addresses below!    "||NL||,
  346.        "okay dokay - Bye For Now!                    "||NL||,
  347.        "                                                               "||NL||,
  348.        "          ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿            "||NL||,
  349.        "          ³ Regards, ÚÄ ÚÄ     ³ ³  2:256/503.0   ³            "||NL||,
  350.        "          ³  ÚÄÄ Ú¿  ÃÄ ÃÄ ÚÄ¿ ÀÂÙ  69:101/11.0   ³            "||NL||,
  351.        "          ³  ÀÄÄ ÃÁ¿ ÀÄ ÀÄ ÃÄÙ  ³   240:360/306   ³            "||NL||,
  352.        "          ³                ³    ³   39:131/11.0   ³            "||NL||,
  353.        "          ³ David.Lascelles@Creepys.nemesis.co.uk ³            "||NL||,
  354.        "          ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ            ","And back please!|Can I see it again!","Creepys Amazing Info!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=cleanibm.font/8",re)
  355.                                  
  356. if retaa=1 then call begin
  357. if retaa=0 then call info       
  358.  
  359. exit 0
  360.  
  361. big:
  362. do g=1 to 3
  363. do f=1 to 3
  364. say g.f.1
  365. if pos.g.f="o" then do
  366. de.g.f.1=" oooo "
  367. de.g.f.2="o    o"
  368. de.g.f.3="o    o"
  369. de.g.f.4=" oooo "
  370. end
  371. if pos.g.f="x" then do
  372. de.g.f.1="\   / "
  373. de.g.f.2=" \_/  "
  374. de.g.f.3=" / \  "
  375. de.g.f.4="/   \ "
  376. end
  377. if pos.g.f=' ' then do
  378. de.g.f.1="      "
  379. de.g.f.2="      "
  380. de.g.f.3="      "
  381. de.g.f.4="      "
  382. end
  383. end
  384. end
  385. board.1="                        #####          #####         "                       
  386. board.2="               "de.1.1.1"   #####  "de.2.1.1"  #####  "de.3.1.1"           "
  387. board.3="               "de.1.1.2"   #####  "de.2.1.2"  #####  "de.3.1.2"           "
  388. board.4="               "de.1.1.3"   #####  "de.2.1.3"  #####  "de.3.1.3"           "
  389. board.5="               "de.1.1.4"   #####  "de.2.1.4"  #####  "de.3.1.4"           "
  390. board.6="                        #####          #####             "
  391. board.7="            ###########################################   "
  392. board.8="            ###########################################   "
  393. board.9="                        #####          #####         "                       
  394. board.10="               "de.1.2.1"   #####  "de.2.2.1"  #####  "de.1.3.1"           "
  395. board.11="               "de.1.2.2"   #####  "de.2.2.2"  #####  "de.1.3.2"           "
  396. board.12="               "de.1.2.3"   #####  "de.2.2.3"  #####  "de.1.3.3"           "
  397. board.13="               "de.1.2.4"   #####  "de.2.2.4"  #####  "de.1.3.4"           "
  398. board.14="                        #####          #####             "
  399. board.15="            ###########################################   "
  400. board.16="            ###########################################   "
  401. board.17="                        #####          #####         "                       
  402. board.18="               "de.1.3.1"   #####  "de.2.3.1"  #####  "de.3.3.1"           "
  403. board.19="               "de.1.3.2"   #####  "de.2.3.2"  #####  "de.3.3.2"           "
  404. board.20="               "de.1.3.3"   #####  "de.2.3.3"  #####  "de.3.3.3"           "
  405. board.21="               "de.1.3.4"   #####  "de.2.3.4"  #####  "de.3.3.4"           "
  406. board.22="                        #####          #####             "
  407.  
  408. fr=rtezrequest(""board.1||NL||,
  409.                ""board.2||NL||,
  410.                ""board.3||NL||,
  411.                ""board.4||NL||,
  412.                ""board.5||NL||,
  413.                ""board.6||NL||,
  414.                ""board.7||NL||,
  415.                ""board.8||NL||,
  416.                ""board.9||NL||,
  417.                ""board.10||NL||,
  418.                ""board.11||NL||,
  419.                ""board.12||NL||,
  420.                ""board.13||NL||,
  421.                ""board.14||NL||,
  422.                ""board.15||NL||,
  423.                ""board.16||NL||,
  424.                ""board.17||NL||,
  425.                ""board.18||NL||,
  426.                ""board.19||NL||,
  427.                ""board.20||NL||,
  428.                ""board.21||NL||,
  429.                ""board.22||NL||,
  430.                ""||NL||,
  431.                ""||NL||,
  432.                "","_Sooooo!|_What|_Tactics|_Are|_You|_Going|_To|_Employ ?","Nice screen dork ;)","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=cleanibm.font/8")
  433.  
  434. call bob